/
/ Code Segment
/
*0200 / code starts at address 0200
Main, cla cll / clear AC and link
tad B / Load B
cia / Negate B
tad A / A - B
jms Abs / take absolute value
dca c / store results at C
hlt / halt
jmp Main / to continue - goto entry point
/
/ Subroutine
/
*0250 / subroutine starts at address 0250
Abs, 0 / store return address here
sma / skip on minus accumulator
jmp .+2 / otherwise jump current address plus 2
cia / negate accumulator
jmp i Abs / return via indirect jump
/
/ Data Segment
/
*0300 / data starts at address 0300
A, 17
B, 22
C, 0
$Main / entry point is Main